package com.dianqiu.common.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.dianqiu.base.dao.impl.BaseDao;
import com.dianqiu.common.bean.DqUserBetConfigTO;
import com.dianqiu.common.dao.DqUserBetConfigDao;

@Component("dqUserBetConfigDao")
public class DqUserBetConfigDaoImpl extends BaseDao implements DqUserBetConfigDao {

	public DqUserBetConfigTO getUserBetConfigByUserId(String userId) {
		DqUserBetConfigTO dqUserBetConfigTO = null;
		List<DqUserBetConfigTO> userBetConfigList = this.getHibernateTemplate().find(" from DqUserBetConfigTO userBetConfig " +
																  " left outer join fetch userBetConfig.dqBetCompany" +
																  " where userBetConfig.userId = " + userId);
		if(userBetConfigList!=null && userBetConfigList.size()>0){
			dqUserBetConfigTO = userBetConfigList.get(0);
		}
		return dqUserBetConfigTO;
	}

	@Override
	public List getAllUserBetConfig() {
		 List<DqUserBetConfigTO> userBetConfigList = this.getHibernateTemplate().find(" from DqUserBetConfigTO userBetConfig " +
				  " left outer join fetch userBetConfig.dqBetCompany " );
		 return userBetConfigList;
	}
	
	
	
	
}



